<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tool="http://schemas.android.com/tools"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.screens.main.FilmDetailsFragment">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageView
                    android:id="@+id/filmImageView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:contentDescription="@string/film_info_image"
                    android:adjustViewBounds="true"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="@dimen/_6sdp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent">

                    <TextView
                        android:id="@+id/rateAndNameTextView"
                        style="@style/film_detail_style"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_margin="@dimen/_6sdp"
                        android:maxLines="1"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        tool:text="@tools:sample/lorem/random" />

                    <TextView
                        android:id="@+id/yearAndGenreTextView"
                        style="@style/film_detail_style"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:maxLines="1"
                        app:layout_constraintEnd_toEndOf="@id/rateAndNameTextView"
                        app:layout_constraintStart_toStartOf="@id/rateAndNameTextView"
                        app:layout_constraintTop_toBottomOf="@id/rateAndNameTextView"
                        tool:text="@tools:sample/lorem/random" />

                    <TextView
                        android:id="@+id/countryAndDurationTextView"
                        style="@style/film_detail_style"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_margin="@dimen/_6sdp"
                        android:maxLines="1"
                        app:layout_constraintBottom_toTopOf="@id/addToSeenImageButton"
                        app:layout_constraintEnd_toEndOf="@id/yearAndGenreTextView"
                        app:layout_constraintStart_toStartOf="@id/yearAndGenreTextView"
                        app:layout_constraintTop_toBottomOf="@id/yearAndGenreTextView"
                        tool:text="@tools:sample/lorem/random" />

                    <ImageButton
                        android:id="@+id/addToFavoriteImageButton"
                        style="@style/film_detail_action_button"
                        android:layout_width="@dimen/film_details_action_button_size"
                        android:layout_height="@dimen/film_details_action_button_size"
                        android:background="@drawable/film_detail_action_button"
                        android:src="@drawable/ic_favorite"
                        app:layout_constraintBottom_toBottomOf="@id/addToCollectionImageButton"
                        app:layout_constraintEnd_toStartOf="@id/addToCollectionImageButton"
                        app:layout_constraintTop_toTopOf="@id/addToCollectionImageButton" />

                    <ImageButton
                        android:id="@+id/addToCollectionImageButton"
                        style="@style/film_detail_action_button"
                        android:layout_width="@dimen/film_details_action_button_size"
                        android:layout_height="@dimen/film_details_action_button_size"
                        android:background="@drawable/film_detail_action_button"
                        android:src="@drawable/ic_collection"
                        app:layout_constraintBottom_toBottomOf="@id/addToSeenImageButton"
                        app:layout_constraintEnd_toStartOf="@id/addToSeenImageButton"
                        app:layout_constraintTop_toTopOf="@id/addToSeenImageButton" />

                    <ImageButton
                        android:id="@+id/addToSeenImageButton"
                        style="@style/film_detail_action_button"
                        android:layout_width="@dimen/film_details_action_button_size"
                        android:layout_height="@dimen/film_details_action_button_size"
                        android:background="@drawable/film_detail_action_button"
                        android:src="@drawable/ic_not_seen"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toBottomOf="@id/countryAndDurationTextView" />

                    <ImageButton
                        android:id="@+id/shareImageButton"
                        style="@style/film_detail_action_button"
                        android:layout_width="@dimen/film_details_action_button_size"
                        android:layout_height="@dimen/film_details_action_button_size"
                        android:background="@drawable/film_detail_action_button"
                        android:src="@drawable/ic_share"
                        app:layout_constraintBottom_toBottomOf="@id/addToSeenImageButton"
                        app:layout_constraintStart_toEndOf="@id/addToSeenImageButton"
                        app:layout_constraintTop_toTopOf="@id/addToSeenImageButton" />

                    <ImageButton
                        android:id="@+id/moreActionsImageButton"
                        style="@style/film_detail_action_button"
                        android:layout_width="@dimen/film_details_action_button_size"
                        android:layout_height="@dimen/film_details_action_button_size"
                        android:background="@drawable/film_detail_action_button"
                        android:src="@drawable/ic_more_actions"
                        app:layout_constraintBottom_toBottomOf="@id/shareImageButton"
                        app:layout_constraintStart_toEndOf="@id/shareImageButton"
                        app:layout_constraintTop_toTopOf="@id/shareImageButton" />
                </androidx.constraintlayout.widget.ConstraintLayout>
            </androidx.constraintlayout.widget.ConstraintLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/default_margins"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/shortDescriptionTextView"
                    style="@style/film_detail_short_description"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="@dimen/_6sdp" />

                <net.expandable.ExpandableTextView
                    android:id="@+id/descriptionTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:collapse_lines="3"
                    app:expand_enabled="true"
                    app:expanded="false" />

                <LinearLayout
                    android:id="@+id/seasonsLinearLayout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:visibility="gone">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">

                        <TextView
                            style="@style/film_category_name"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="3"
                            android:text="@string/film_detail_seasons_and_series" />

                        <Button
                            android:id="@+id/showAllSerialSeasonsButton"
                            style="@style/film_all_button"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/show_all_button" />
                    </LinearLayout>

                    <TextView
                        android:id="@+id/seasonTextView"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />

                    <TextView
                        android:id="@+id/seasonAndSeriesCountTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/actorsLayout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"

                    android:visibility="gone">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">

                        <TextView
                            style="@style/film_category_name"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="3"
                            android:text="@string/film_detail_actors" />

                        <Button
                            android:id="@+id/showAllActorsButton"
                            style="@style/film_all_button"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:visibility="gone" />
                    </LinearLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/actorsRecyclerView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                        app:spanCount="4" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/staffLayout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:visibility="gone">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">

                        <TextView
                            style="@style/film_category_name"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="3"
                            android:text="@string/film_detail_staff" />

                        <Button
                            android:id="@+id/showAllStaffButton"
                            style="@style/film_all_button"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:visibility="gone" />
                    </LinearLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/staffRecyclerView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                        app:spanCount="2" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/galleryLayout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:visibility="gone">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">

                        <TextView
                            style="@style/film_category_name"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="3"
                            android:text="@string/film_detail_gallery" />

                        <Button
                            android:id="@+id/showAllGalleryButton"
                            style="@style/film_all_button"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:visibility="gone" />
                    </LinearLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/galleryRecyclerView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/similarLayout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:visibility="gone">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">

                        <TextView
                            style="@style/film_category_name"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="3"
                            android:text="@string/film_detail_similar_films" />

                        <Button
                            android:id="@+id/showAllSimilarButton"
                            style="@style/film_all_button"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:visibility="gone" />
                    </LinearLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/similarRecyclerView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </ScrollView>

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@android:color/transparent"
            android:elevation="@dimen/_6sdp"
            app:navigationIcon="@drawable/ic_back_navigation" />
    </com.google.android.material.appbar.AppBarLayout>
</androidx.constraintlayout.widget.ConstraintLayout>